From 9e5594353f2e37ad5dd96251fdb6de602ae99dc4 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Tue, 29 Jan 2008 16:18:55 +0000 Subject: [PATCH] Add an info to the comment field of the newuserlog when an account was created "by email" This was inspired by bug 12767 to identify such accounts. --- docs/hooks.txt | 2 ++ includes/SpecialLog.php | 2 +- includes/SpecialUserlogin.php | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index acfc86da74..b059299ef5 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -257,6 +257,7 @@ $message: out parameter: error message to display on abort 'AddNewAccount': after a user account is created $user: the User object that was created. (Parameter added in 1.7) +$byEmail: true when account was created "by email" (added in 1.12) 'AjaxAddScript': Called in output page just before the initialisation of the javascript ajax engine. The hook is only called when ajax @@ -659,6 +660,7 @@ $paramArray: Array of parameters that corresponds to logging.log_params field. N appears to contain anything. &$comment: string that corresponds to logging.log_comment database field, and which is displayed in the UI. &$revert: string that is displayed in the UI, similar to $comment. +$time: timestamp of the log entry (added in 1.12) 'LogPageValidTypes': action being logged. DEPRECATED: Use $wgLogTypes &$type: array of strings diff --git a/includes/SpecialLog.php b/includes/SpecialLog.php index be8649b76b..1671e6d216 100644 --- a/includes/SpecialLog.php +++ b/includes/SpecialLog.php @@ -402,7 +402,7 @@ class LogViewer { array('target' => $paramArray[0], 'dest' => $title->getPrefixedText(), 'mergepoint' => $paramArray[1] ) ) ) . ')'; - } elseif ( wfRunHooks( 'LogLine', array( $s->log_type, $s->log_action, $title, $paramArray, &$comment, &$revert ) ) ) { + } elseif ( wfRunHooks( 'LogLine', array( $s->log_type, $s->log_action, $title, $paramArray, &$comment, &$revert, $s->log_timestamp ) ) ) { // wfDebug( "Invoked LogLine hook for " $s->log_type . ", " . $s->log_action . "\n" ); // Do nothing. The implementation is handled by the hook modifiying the passed-by-ref parameters. } diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 8ee0f36b83..02bb1fe39f 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -125,7 +125,7 @@ class LoginForm { $u->saveSettings(); $result = $this->mailPasswordInternal( $u, false, 'createaccount-title', 'createaccount-text' ); - wfRunHooks( 'AddNewAccount', array( $u ) ); + wfRunHooks( 'AddNewAccount', array( $u, true ) ); $wgOut->setPageTitle( wfMsg( 'accmailtitle' ) ); $wgOut->setRobotpolicy( 'noindex,nofollow' ); @@ -856,3 +856,4 @@ class LoginForm { } } + -- 2.20.1